#ifndef TCPKERNEL_H
#define TCPKERNEL_H
#include"IKernel.h"
#include <QObject>
#include"../client/tcpclient.h"
#include"Packdef.h"
class tcpkernel : public QObject,public IKernel
{
    Q_OBJECT
public:
    explicit tcpkernel(QObject *parent = nullptr);
    
    ~tcpkernel();
signals:

    void signal_register(STRU_REGISTER_RS*);//信号
    void signal_login(STRU_LOGIN_RS*);
    void signal_getfilelist(STRU_GETFILELIST_RS*);
    void signal_uploadfile(STRU_UPLOADFILEINFO_RS*);
    void signal_downloadfileinfo(STRU_DOWNLOADFILEINFO_RS*);
    void signal_downloadfileblock(STRU_DOWNLOADFILEBLOCK_RS*);
    void signal_deletefile(STRU_DELETEFILE_RS *);
    void signal_searchfile(STRU_SEARCHFILE_RS*);
    void signal_rename(STRU_RENAME_RS*);
public:
     bool open(const char* szip = "127.0.0.1",short sport=1234);
     void close(const char* szerr="");
     bool sendData(const char* szbuf,int nlen);
     void dealDate(const char* szbuf);

private:
     INet*m_pTCPNet;

};

#endif // TCPKERNEL_H
